package com.zhoug.tmap.dianditu;

import org.osmdroid.tileprovider.tilesource.XYTileSource;
import org.osmdroid.util.MapTileIndex;

/**
 * 天地图瓦片资源
 * @Author: zhoug
 * @Date: 2024-12-27
 * @Description:
 */
@Deprecated
public class TianTileSource extends XYTileSource {

    public TianTileSource(String mapKey) {
        super(  "Tian Di Tu", 0, 20, 256, "", new String[]{
                "http://t0.tianditu.com/DataServer?T=cia_w&tk=" + mapKey,
                "http://t1.tianditu.com/DataServer?T=cia_w&tk=" + mapKey,
                "http://t2.tianditu.com/DataServer?T=cia_w&tk=" + mapKey,
                "http://t3.tianditu.com/DataServer?T=cia_w&tk=" + mapKey,
                "http://t4.tianditu.com/DataServer?T=cia_w&tk=" + mapKey,
                "http://t5.tianditu.com/DataServer?T=cia_w&tk=" + mapKey,
                "http://t6.tianditu.com/DataServer?T=cia_w&tk=" + mapKey,
                "http://t7.tianditu.com/DataServer?T=cia_w&tk=" + mapKey,

        });
    }

    @Override
    public String getTileURLString(long pMapTileIndex) {
        return  getBaseUrl() +"&L="+ MapTileIndex.getZoom(pMapTileIndex) + "&X=" + MapTileIndex.getX(pMapTileIndex) + "&Y=" + MapTileIndex.getY(pMapTileIndex)
                + mImageFilenameEnding;
    }


}
